/* GUI CONVERTED from regetwcm.i (converter v1.76) Thu Apr 25 19:00:56 2002 */
/* regetwcm.i - REPETITIVE                                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.6 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3            CREATED: 10/31/94   BY: WUG *GN77*                */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown         */
/* REVISION: 9.1      LAST MODIFIED: 08/28/00   BY: *N0P6* Arul Victoria      */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.3.1.6 $   BY: Jean Miller        DATE: 04/16/02  ECO: *P05H*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* GETS WORKCENTER/MACHINE FROM THE USER                                      */

define new shared variable global_wkctr as character.

do with frame {&framename} on error undo, retry:
/*GUI*/ if global-beam-me-up then undo, leave.


   set
      wkctr mch
   editing:

      global_wkctr = input frame {&framename} wkctr.

      if frame-field = "wkctr" then do:
         {mfnp05.i wc_mstr wc_wkctr yes wc_wkctr
            "input frame {&framename} wkctr"}

         if recno <> ? then do:
            display wc_wkctr @ wkctr wc_mch @ mch wc_desc.
            find dpt_mstr no-lock where dpt_dept = wc_dept no-error.

            if available dpt_mstr then do:
               dept = dpt_dept.
               display dept dpt_desc.
            end.

            else display " " @ dpt_desc.
         end.
      end.

      else
      if frame-field = "mch" then do:
         {mfnp05.i wc_mstr wc_wkctr "wc_wkctr = input frame {&framename} wkctr"
            wc_mch "input frame {&framename} mch"}

         if recno <> ? then do:
            display wc_wkctr @ wkctr wc_mch @ mch wc_desc.
            find dpt_mstr no-lock where dpt_dept = wc_dept no-error.

            if available dpt_mstr then do:
               dept = dpt_dept.
               display dept dpt_desc.
            end.

            else display " " @ dpt_desc.
         end.
      end.

      else do:
         status input.
         readkey.
         apply lastkey.
      end.

   end.

   find wc_mstr where wc_wkctr = wkctr and wc_mch = mch
   no-lock no-error.

   if not available wc_mstr then do:
      /* Work Center/Machine does not exist */
      {pxmsg.i &MSGNUM=519 &ERRORLEVEL=3}
      undo , retry.
   end.

   display wc_desc.
   find dpt_mstr no-lock where dpt_dept = wc_dept no-error.

   if available dpt_mstr then do:
      dept = dpt_dept.
      display dept dpt_desc.
   end.
   else
      display " " @ dpt_desc.

end.
/*GUI*/ if global-beam-me-up then undo, leave.

